package com.smart.controller;

import com.smart.entity.Result;
import com.smart.service.INoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Cookies
 * @since 2024-05-06
 */
@RestController
@CrossOrigin
@RequestMapping("/notice")
@Api(tags = "公告相关接口")
public class NoticeController {
    @Autowired
    private INoticeService noticeService;

    @GetMapping
    @ApiOperation(value = "默认获取最新5条公告", response = Result.class)
    public Result getNoticeList() {
        return Result.success(noticeService.getNoticeList());
    }
}
